#ifndef _TWOGRE_BUTTON_H_
#define _TWOGRE_BUTTON_H_

#include "TwOgrePrerequisites.h"
#include "TwOgreVariable.h"

#include "OgreString.h"

namespace TwOgre{
	class Window;

    class ButtonParams
    {
    public:
        ButtonParams(const Ogre::String& name)
            : parent_(0)
            , name_(name)
            , label_(Ogre::StringUtil::BLANK)
            , group_(Ogre::StringUtil::BLANK)
            , help_(Ogre::StringUtil::BLANK)
            , shortcut_(Ogre::StringUtil::BLANK)
            , type_(TW_TYPE_UNDEF)
            , data_(NULL)
            , buttonCB_(NULL)
        {}
     
        ButtonParams& label(const Ogre::String& varLabel)
        {
            label_ = varLabel;
            return *this;
        }
        ButtonParams& group(const Ogre::String& varGroup)
        {
            group_ = varGroup;
            return *this;
        }
        ButtonParams& help(const Ogre::String& varHelp)
        {
            help_ = varHelp;
            return *this;
        }
        ButtonParams& shortcut(const Ogre::String& varShortcut)
        {
            shortcut_ = varShortcut;
            return *this;
        }
        ButtonParams& callback(TwButtonCallback varButtonCB, void* varData)
        {
            buttonCB_ = varButtonCB;
            data_ = varData;
            return *this;
        }
    private:
		Window* parent_;
		Ogre::String name_;
        Ogre::String label_;
        Ogre::String group_;
        Ogre::String help_;
        Ogre::String shortcut_;
		TwType type_;
        void* data_;
        TwButtonCallback buttonCB_;

    	friend class Window;
		friend class ButtonVariable;		
    };
    
    /**
	 * Variable.
	 * This is used as the base class for all specific Variable types.
	 */
	class TwOgreExport ButtonVariable : public Variable
	{
	protected:
		/**
		 * Constructor.
		 * @param parent Pointer to the parent Window.
		 * @param name Name used to refer to the variable, but be unique for this Window.
		 * @param type AntTweakBar type used to determine which Variable was made.
		 *
		 * @note This constructor should never be called directly, instead all Variables 
		 * should be created through their parent Windows.
		 */
		ButtonVariable(Window* parent, const Ogre::String& name, const Ogre::String& label, const Ogre::String& groupName, const Ogre::String& help, TwButtonCallback  callback = NULL, void* data = NULL);
		ButtonVariable(ButtonParams& params);
		 /** Destructor */
		virtual ~ButtonVariable();

		/** Return the AntTweakBar type of this Variable so the parent Window can determine the type of varible this is. */
		TwType getType() const {return mVarType;}

	public:
		/** Returns the name of the Variable. */
		const Ogre::String& getName() const {return mName;}
		void setShortcut(const Ogre::String& execute);

	protected:
		friend class Window;
		friend class WindowManager;
	};
}; // End Namespace
#endif
